home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER$: LhAAppIcon.dopus5 1.0 (1.9.98)
- Call as: LhAAppIcon.dopus5 {Qp}
- */
- options results
- parse arg port .
-
- lf = '0a'x
- LhAID = 'aLHA' /* Change this line to suit your LhA filetype ID */
- iconname = 'DOpus5:Icons/filetypes/Archive'
- output = 'RAM:'
- if port = '' then port = 'DOPUS.1'
- address value port
-
- If ~Show('L','rexxsupport.library') then call addlib('rexxsupport.library',0,-30,0)
-
- call openport('LhAAppIcon-handler')
- appmenu.count = 1
- appmenu.0 = 'Config'
- dopus addappicon 'LhAAppIcon-handler' "'LhAAppIcon'" 1 icon iconname info quotes close local menu appmenu.
- iconhandle = result
- flag = 0
- do while flag = 0
- if waitpkt('LhAAppIcon-handler') then do
- packet = getpkt('LhAAppIcon-handler')
- arg0 = getarg(packet,0)
- arg1 = getarg(packet,1)
- arg2 = getarg(packet,2)
- arg3 = getarg(packet,3)
- arg4 = getarg(packet,4)
- call reply(packet,0)
- if arg0 = 'menu' & arg2 = 0 then call Config
- if arg0 = 'info' then do
- text = 'LhAAppIcon 1.0 (1.9.98)'||lf||lf||'G''day :)'
- dopus request '"'text'" OK'
- end
- if arg0 = 'dropfrom' then call WeGotOne
- if arg0 = 'close' then flag = 1
- if arg0 = 'removed' then flag = 2
- end
- end
- if flag~=2 then dopus remappicon iconhandle
- call closeport('LhAAppIcon-handler')
- exit
-
- Config:
- valid = 0
- do while valid = 0
- text = '"Please enter a path to extract files to:" 30 "'output||'" OK|Cancel'
- dopus getstring text
- if dopusrc = 0 | result = '' then result = 'RAM:'
- if pos(right(strip(result,,'"'),1),':/') > 0 then
- if exists(result) then do
- valid = 1
- output = result
- end
- end
- return
-
- WeGotOne:
- if arg2 = '' then return
- lister query arg3 path
- path = result
- dopus setappicon iconhandle busy on
- files = arg2
- do while files ~= ''
- parse var files'"'file'"' files
- file = strip(path,,'"')||strip(file,,'"')
- dopus getfiletype '"'file'"' ID
- if result = LhAID then
- address command 'LhA >NIL: x "'file'" 'output
- end
- dopus setappicon iconhandle busy off
- return
-